1 Executive Summary

Suicide is a growing problem in many places around the globe in the 21st century. This report aims to determine whether there is a correlation between socio-economic and health factors and suicide rate through the comparison of gross domestic product, age, sex, and unemployment rate. Through the comparison of these variables, the report will explore the trends in the data to understand why the trends found exist and what is potentially driving the changes.

Income vs Suicide Rate: A trend appeared in all 4 time periods spanning 2005-2015, there is a moderate inversely proportional relationship between suicide rate and income, especially at the upper extremities, where high suicide rates/incomes are exhibited in countries of low incomes/suicide rates, respectively.

Age & sex vs suicide rate: The last 15 years have shown a gradual decline in average suicide rate globally. This is because the 21st century society has become more aware of the causes of suicide and societal expectations have changed.

Unemployment vs Suicide Rate: Unemployment has shown to be a causal factor of suicide as it causes a loss of social status and structure, financial strain, and has a significant social stigma attached to it.


2 Full Report

2.1 Initial Data Analysis (IDA)

Suicide claims over 800,000 lives worldwide annually, contributing to 1.4% of deaths globally in 2016. It is a complex phenomenon, and understanding contributing factors to suicide are important in improving prevention. By comparing suicide rates across 135 countries with sex, income, and unemployment, we hope to see trends in the data which allow for an effective delineation of some of the causes of suicide.

To compare incomes internationally, GDP (Gross domestic product) per capita is not an accurate measure, since the spending power of that income is not equal. Thus, GDP at PPP (purchasing power of parity) provides a normalised value for income, removing spending power of income as a confounding factor. Unemployment rate is an ideal statistic to use, as it represents the percentage of people willing and able to, but unable to find work, which can be linked to loss of status, social stigma and other factors increasing suicide risk.

To source our variables, multiple datasets were used sources. A World Health Organisation data set (dataset 1), containing country (factor), year (integer), sex (factor), age range (factor), suicide number (integer), and suicide rate (number) was used to compare global suicide rate with sex and age. However, a second dataset (dataset 2) was used for the first and second research questions. After cleaning and shortening the time span of the investigation (to reflect the time period of recorded data), dataset 2 contained seven variables: country (factor), year (integer), sex (factor), suicide rate (number), unemployment rate (number), PPP (number), and continent/region (factor). Utilising two datasets ensured that the data was valid as the values were compared to ensure consistency.

The validity of the source was also checked for reputability. Dataset 1 was sourced from the World Health Organisation (WHO), an autonomous organisation working with the United Nations focusing on international world health.The WHO’s autonomy, UN association and healthcare specialty mean the health data used is very unlikely to be false/biased. Economic data for dataset 2 was sourced from the World Bank, a financial institution with 189 member countries, aiming to reduce poverty. World Bank’s economic specialty and international recognition/participation means there is little cause for manipulating economic data, making it also reliable.


Stakeholders with an interest in this report include:

- The health sector globally has to have the resources available to support and reduce current suicide rates. Analysing the past and present data allows governments and those who fund the health sector to make decisions on how resources and money should be allocated to effectively address the issue of suicide.

- The education sector plays a significant role in the reduction of suicide rates through the education of the population on the factors that contribute to suicide.

- Governments have an obligation to efficiently and effectively address the needs of their people. Analysing trends of suicide rates allows governments to make the necessary changes to budgets to ensure that the issue they face as a nation is addressed and minimised.

library(plotly)
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.5.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
# LOAD DATA v1 - uncomment the link below to: load data direct from html
setwd("C:/Users/anosh/Documents/Anosh's Data/!_Uni_!/Sem 1/DATA1001 - Intro to Data/Assignment 1")
su_rate1 = read.csv("Data/who_suicide_statistics_NOBLANKS.csv")
su_rate2 = read.csv("Data/Tidy Data Set - Suicide Rates (REVISED).csv")

# LOAD DATA v2 - uncomment the link below to: load data from local file
#cars = read.csv("dataset file location")

# Quick look at top 5 rows of data
head(su_rate1)
##   country year    sex         age suicides_no population     rate Region
## 1 Albania 1987 female 15-24 years          14     289700 4.832585 Europe
## 2 Albania 1987 female 25-34 years           4     257200 1.555210 Europe
## 3 Albania 1987 female 35-54 years           6     278800 2.152080 Europe
## 4 Albania 1987 female  5-14 years           0     311000 0.000000 Europe
## 5 Albania 1987 female 55-74 years           0     144600 0.000000 Europe
## 6 Albania 1987 female   75+ years           0      35600 2.808989 Europe
head(su_rate2)
##       Country Year Gender Suicide.Rate Unemployment.Rate
## 1 Afghanistan 2000   Male         10.9              11.2
## 2 Afghanistan 2000 Female          2.3              11.2
## 3 Afghanistan 2005   Male         11.7               8.5
## 4 Afghanistan 2005 Female          2.6               8.5
## 5 Afghanistan 2010   Male         11.1               7.8
## 6 Afghanistan 2010 Female          2.8               7.8
##   GDP.Per.Capita....PPP. Region
## 1                  0.000   Asia
## 2                  0.000   Asia
## 3               1011.596   Asia
## 4               1011.596   Asia
## 5               1581.601   Asia
## 6               1581.601   Asia
## Size of data
dim(su_rate1)
## [1] 36060     8
dim(su_rate2)
## [1] 1080    7
## R's classification of data
class(su_rate1)
## [1] "data.frame"
class(su_rate2)
## [1] "data.frame"
## R's classification of variables
str(su_rate1)
## 'data.frame':    36060 obs. of  8 variables:
##  $ country    : Factor w/ 118 levels "Albania","Antigua and Barbuda",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ year       : int  1987 1987 1987 1987 1987 1987 1987 1987 1987 1987 ...
##  $ sex        : Factor w/ 2 levels "female","male": 1 1 1 1 1 1 2 2 2 2 ...
##  $ age        : Factor w/ 6 levels "15-24 years",..: 1 2 3 4 5 6 1 2 3 4 ...
##  $ suicides_no: int  14 4 6 0 0 0 21 9 16 0 ...
##  $ population : int  289700 257200 278800 311000 144600 35600 312900 274300 308000 338200 ...
##  $ rate       : num  4.83 1.56 2.15 0 0 ...
##  $ Region     : Factor w/ 8 levels "Africa","Asia",..: 4 4 4 4 4 4 4 4 4 4 ...
str(su_rate2)
## 'data.frame':    1080 obs. of  7 variables:
##  $ Country               : Factor w/ 135 levels "Afghanistan",..: 1 1 1 1 1 1 1 1 2 2 ...
##  $ Year                  : int  2000 2000 2005 2005 2010 2010 2015 2015 2000 2000 ...
##  $ Gender                : Factor w/ 2 levels "Female","Male": 2 1 2 1 2 1 2 1 2 1 ...
##  $ Suicide.Rate          : num  10.9 2.3 11.7 2.6 11.1 2.8 10.9 3.1 9.8 3.1 ...
##  $ Unemployment.Rate     : num  11.2 11.2 8.5 8.5 7.8 7.8 8.9 8.9 22.7 22.7 ...
##  $ GDP.Per.Capita....PPP.: num  0 0 1012 1012 1582 ...
##  $ Region                : Factor w/ 8 levels "Africa","Asia",..: 2 2 2 2 2 2 2 2 4 4 ...

2.2 Investigating the Relationship Between Income ($ PPP) and Suicde Rates

Suicide is a well documented but poorly understood human behaviour which may stem from a number of causes. According to the WHO (2018), low and middle income represent 79% of completed suicide. Thus, it is possible lower income countries could could display a higher rate of completing suicide. Conversely, it may be higher income countries who are at greater risk of completing suicide, since increased levels of income past a certain point may result in lower life satisfaction (Jebb, Tay, Diener, & Oishi, 2018) and the loss of pleasure in life is a psychosocial state which increases risk of completing suicide (Cucher, & Chehill, 2012).

So the question is: What is the correlation between income and suicide rates in countries across the world?

In the four scatter plots produced showing Income (GDP at PPP) vs. Suicide Rate (per 100,000) for the years 2000, 2005, 2010 and 2015, a non-linear trend emerged showing an inversely proportional relationship between income and suicide rate. This trend was increasingly obvious at the extremes, with the highest income countries displaying low suicide rates and the highest suicide rate countries typically being low income. However, this rule was not applicable in reverse (low suicide rates could occur in countries of low or high income and low income countries could have low or high suicide rates). Interestingly, between 2005 and 2015, the above trend has become less clear, with the 2015 high incomes and suicide rates being a worse predictor of low suicide rates and incomes, respectively.

GDP2000 <- filter(su_rate2, su_rate2$Year == "2000" & su_rate2$GDP.Per.Capita....PPP. > 0)

x <- list(
  title = "Income ($ PPP)"
)

y <- list(
  title = "Suicide Rate (per 100,000)"
)

p1 <- plot_ly(GDP2000, x = ~GDP.Per.Capita....PPP., y = ~Suicide.Rate, color = ~Region, type = "scatter",
             text = ~paste("Region: ",Region, '<br>Country:', Country,'<br>Suicide Rate:', Suicide.Rate, '<br>Income ($ PPP):', GDP.Per.Capita....PPP., '<br>Gender:', Gender)) %>%

    layout(
    title = "Suicide Rate vs. Income($ PPP) Across Different Countries and Regions (2000)"
    , xaxis = x, yaxis = y) 
p1
library(plotly)

GDP2005 <- filter(su_rate2, su_rate2$Year == "2005" & su_rate2$GDP.Per.Capita....PPP. > 0)

x <- list(
  title = "Income ($ PPP)"
)

y <- list(
  title = "Suicide Rate (per 100,000)"
)

p1 <- plot_ly(GDP2005, x = ~GDP.Per.Capita....PPP., y = ~Suicide.Rate, color = ~Region, type = "scatter",
             text = ~paste("Region: ",Region, '<br>Country:', Country, '<br>Suicide Rate:', Suicide.Rate, '<br>Income ($ PPP):', GDP.Per.Capita....PPP., '<br>Gender:', Gender)) %>%

    layout(
    title = "Suicide Rate vs. Income($ PPP) Across Different Countries and Regions (2005)"
    , xaxis = x, yaxis = y) 
p1
library(plotly)

GDP2010 <- filter(su_rate2, su_rate2$Year == "2010" & su_rate2$GDP.Per.Capita....PPP. > 0)

x <- list(
  title = "Income ($ PPP)"
)

y <- list(
  title = "Suicide Rate (per 100,000)"
)

p1 <- plot_ly(GDP2010, x = ~GDP.Per.Capita....PPP., y = ~Suicide.Rate, color = ~Region, type = "scatter",
             text = ~paste("Region: ",Region, '<br>Country:', Country, '<br>Suicide Rate:', Suicide.Rate, '<br>Income ($ PPP):', GDP.Per.Capita....PPP., '<br>Gender:', Gender)) %>%

    layout(
    title = "Suicide Rate vs. Income($ PPP) Across Different Countries and Regions (2010)"
    , xaxis = x, yaxis = y) 
p1
library(plotly)

GDP2015 <- filter(su_rate2, su_rate2$Year == "2015" & su_rate2$GDP.Per.Capita....PPP. > 0)

x <- list(
  title = "Income ($ PPP)"
)

y <- list(
  title = "Suicide Rate (per 100,000)"
)

p1 <- plot_ly(GDP2015, x = ~GDP.Per.Capita....PPP., y = ~Suicide.Rate, color = ~Region, type = "scatter",
             text = ~paste("Region: ",Region, '<br>Country:', Country, '<br>Suicide Rate:', Suicide.Rate, '<br>Income ($ PPP):', GDP.Per.Capita....PPP., '<br>Gender:', Gender)) %>%

    layout(
    title = "Suicide Rate vs. Income($ PPP) Across Different Countries and Regions (2015)"
    , xaxis = x, yaxis = y) 
p1

2.3 Investigating the Relationship Between Unemployment and Suicide Rate

Suicide is a global epidemic that is one of the largest contributors of premature mortality and is attributed to revealing a causal link between suicide and unemployment as the impact of being unemployed is not simply the economic pressure of a reduced income but also, the loss of status and structure which work provides. Furthermore, the social stigma attached to the loss of status adds greater pressure on unemployed individuals [Imogen Tyler]. The causational relationship between unemployment and suicide can be seen throughout history with Australian male suicide rates peaking during the 1930’s Great Depression [Social Science & Medicine, Volume 36 Issue 6 Pages 715-841 (March 1993)].

Larger inquiries into the relationship between unemployment and suicide have also found a causal link with 45,000 (???) suicides a year being attributed to unemployment [by Carlos Nordt and colleagues at the University of Zurich]. Through our research into the relationship between these 2 phenomenons, we have also come to the conclusion that unemployment and suicide share a link of causation. This is clearly seen through a direct comparison of the 4 separate graphs of the relationship between suicide and unemployment revealing that the general distribution of the data remains the same across different time periods. Furthermore, the comparison of the 2000 visualisation and the 2015 visualisation represents that regions experienced 20-30% rises in unemployment rates whilst also simultaneously recording an increase of approximately 12% in suicide rates during the same period [also found by Dr Carlos Nordt in Lancet Psychiatry Volume 2, Issue 3, P239-245, March 01, 2015] reiterating the consistent nature of the causal link between unemployment and suicide.

Thus, it is clear that unemployment and suicide share a causational link which is consistent for the majority of countries and regions around the globe, with inconsistencies only arising due to differences in social security policies of specific countries.

library(plotly)

UR2000 <- filter(su_rate2, su_rate2$Year == "2000" & su_rate2$Unemployment.Rate > 0)

## 
x <- list(
  title = "Unemployment Rate (%)"
)

y <- list(
  title = "Suicide Rate (per 100,000)"
)

p1 <- plot_ly(UR2000, x = ~Unemployment.Rate, y = ~Suicide.Rate, color = ~Region, type = "scatter",
             text = ~paste("Region: ",Region, '<br>Country:', Country, '<br>Suicide Rate:', Suicide.Rate, '<br>Unemployment Rate (%):', Unemployment.Rate, '<br>Gender:', Gender)) %>%

    layout(
    title = "Suicide Rate vs. Unemployment Rate (%) Across Different Countries and Regions (2000)"
    , xaxis = x, yaxis = y) 
p1
library(plotly)

UR2005 <- filter(su_rate2, su_rate2$Year == "2005" & su_rate2$Unemployment.Rate > 0)

x <- list(
  title = "Unemployment Rate (%)"
)

y <- list(
  title = "Suicide Rate (per 100,000)"
)

p1 <- plot_ly(UR2005, x = ~Unemployment.Rate, y = ~Suicide.Rate, color = ~Region, type = "scatter",
             text = ~paste("Region: ",Region, '<br>Country:', Country, '<br>Suicide Rate:', Suicide.Rate, '<br>Unemployment Rate (%):', Unemployment.Rate, '<br>Gender:', Gender)) %>%

    layout(
    title = "Suicide Rate vs. Unemployment Rate (%) Across Different Countries and Regions (2005)"
    , xaxis = x, yaxis = y) 
p1
library(plotly)

UR2010 <- filter(su_rate2, su_rate2$Year == "2010" & su_rate2$Unemployment.Rate > 0)

x <- list(
  title = "Unemployment Rate (%)"
)

y <- list(
  title = "Suicide Rate (per 100,000)"
)

p1 <- plot_ly(UR2010, x = ~Unemployment.Rate, y = ~Suicide.Rate, color = ~Region, type = "scatter",
             text = ~paste("Region: ",Region, '<br>Country:', Country, '<br>Suicide Rate:', Suicide.Rate, '<br>Unemployment Rate (%):', Unemployment.Rate, '<br>Gender:', Gender)) %>%

    layout(
    title = "Suicide Rate vs. Unemployment Rate (%) Across Different Countries and Regions (2010)"
    , xaxis = x, yaxis = y) 
p1
library(plotly)

UR2015 <- filter(su_rate2, su_rate2$Year == "2015" & su_rate2$Unemployment.Rate > 0)

x <- list(
  title = "Unemployment Rate (%)"
)

y <- list(
  title = "Suicide Rate (per 100,000)"
)

p1 <- plot_ly(UR2015, x = ~Unemployment.Rate, y = ~Suicide.Rate, color = ~Region, type = "scatter",
             text = ~paste("Region: ",Region, '<br>Country:', Country, '<br>Suicide Rate:', Suicide.Rate, '<br>Unemployment Rate (%):', Unemployment.Rate, '<br>Gender:', Gender)) %>%

    layout(
    title = "Suicide Rate vs. Unemployment Rate (%) Across Different Countries and Regions (2015)"
    , xaxis = x, yaxis = y) 
p1

2.4 Investigating the Relationship between Age and Sex with respect to Suicide Rates

When determining which countries to investigate further in this project, countries that had unique, dramatic or otherwise interesting trends in their data, were the main focus. Taking this into consideration, the US appeared distinct.

The US consistently showed increasing trends across the fifteen year period. Investigating this further, it was found that suicide was the tenth leading cause of death in the US in 2016 (AFSP, 2016). Comparing the 2015 US Average Suicide Rate graph in our data, to the 2015 World Average Suicide Rate graph, the US average suicide rate for men was at 23.36 while the World average was at 16.63, presenting a higher than average suicide rate among American men. Furthermore, more than fifty percent of those who committed suicide had no known diagnosed mental health conditions at the time of death, with relationship issues, substance abuse, physical health issues, and monetary issues contributing more significantly (CDC, 2018).

A second phenomenon that trends in the data reflected was the difference between the suicide rate among men and women. In the US in 2015, suicide was the seventh leading cause of death for men and the fourteenth for women (CDC, 2015). Women attempted suicide 1.2 times more often than men (CDC, 2016), however, as according to our data of the 2015 world average, the average suicide rate for women was just 4.5, while, as stated before, the world average suicide rate for men was 16.6. This means that, worldwide, the suicide rate for men is 3.7 times higher than the women’s rate. This trend of the men’s suicide rate being significantly higher translated across the vast majority of suicide rates in countries across our data. In our research, we found that the driving forces behind these statistics are the fact the men seek medical and professional help less often than women do and that there is a high rate of untreated depressive disorders among men (Wittchen et al., 1999). Furthermore, symptoms of depression often deviate from traditionally masculine stereotypes. This link between symptoms of depression and femininity often motivates men to hide their depression from those around them (Warren 1983).

library(plotly)

a <-filter(su_rate1, su_rate1$year == "2000" &  su_rate1$sex == "male" & su_rate1$age =="5-14 years") 
a1 <- mean(a$rate)
a2 <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="5-14 years")
a3 <- mean(a2$rate)

b <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="15-24 years") 
b1 <- mean(b$rate)
b2 <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="15-24 years")
b3 <- mean(b2$rate)

c <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="25-34 years") 
c1 <- mean(c$rate)
c2 <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="25-34 years")
c3 <- mean(c2$rate)

d <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="35-54 years") 
d1 <- mean(d$rate)
d2 <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="35-54 years")
d3 <- mean(d2$rate)

e <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="55-74 years") 
e1 <- mean(e$rate)
e2 <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="55-74 years")
e3 <- mean(e2$rate)

f <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="75+ years") 
f1 <- mean(f$rate)
f2 <-filter(su_rate1, su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="75+ years")
f3 <- mean(f2$rate)

table <- data.frame(x = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"),
                    y = c(a1, b1, c1, d1, e1, f1))
table$x <- factor(table$x, levels = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"))


p1 <- plot_ly(
  data = table,
  x = ~x,
  y = ~y, 
  type = "bar",
  name = "Male",
  color = I("dodgerblue4")
 
  
) %>%
  
  add_trace(
    y = c(a3, b3, c3, d3, e3, f3),
    name = "Female",
    color = I("firebrick4")
      ) %>%
  
  layout(
    title = "World Average Suicide Rate Across Different Age Categories (2000)", 
    yaxis = list(
      title = "Suicide Rate (per 100,000)"),
    xaxis = list(
      title = "Age"),
    
      barmode = "group"
    )
  

p1
library(plotly)

a <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="5-14 years") 
a1 <- mean(a$rate)
a2 <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="5-14 years")
a3 <- mean(a2$rate)

b <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="15-24 years") 
b1 <- mean(b$rate)
b2 <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="15-24 years")
b3 <- mean(b2$rate)

c <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="25-34 years") 
c1 <- mean(c$rate)
c2 <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="25-34 years")
c3 <- mean(c2$rate)

d <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="35-54 years") 
d1 <- mean(d$rate)
d2 <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="35-54 years")
d3 <- mean(d2$rate)

e <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="55-74 years") 
e1 <- mean(e$rate)
e2 <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="55-74 years")
e3 <- mean(e2$rate)

f <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="75+ years") 
f1 <- mean(f$rate)
f2 <-filter(su_rate1, su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="75+ years")
f3 <- mean(f2$rate)

table <- data.frame(x = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"),
                    y = c(a1, b1, c1, d1, e1, f1))
table$x <- factor(table$x, levels = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"))


p1 <- plot_ly(
  data = table,
  x = ~x,
  y = ~y, 
  type = "bar",
  name = "Male",
  color = I("dodgerblue4")
 
  
) %>%
  
  add_trace(
    y = c(a3, b3, c3, d3, e3, f3),
    name = "Female",
    color = I("firebrick4")
      ) %>%
  
  layout(
    title = "World Average Suicide Rate Across Different Age Categories (2005)", 
    yaxis = list(
      title = "Suicide Rate (per 100,000)"),
    xaxis = list(
      title = "Age"),
    
      barmode = "group"
    )
  

p1
library(plotly)

a <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="5-14 years") 
a1 <- mean(a$rate)
a2 <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="5-14 years")
a3 <- mean(a2$rate)

b <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="15-24 years") 
b1 <- mean(b$rate)
b2 <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="15-24 years")
b3 <- mean(b2$rate)

c <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="25-34 years") 
c1 <- mean(c$rate)
c2 <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="25-34 years")
c3 <- mean(c2$rate)

d <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="35-54 years") 
d1 <- mean(d$rate)
d2 <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="35-54 years")
d3 <- mean(d2$rate)

e <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="55-74 years") 
e1 <- mean(e$rate)
e2 <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="55-74 years")
e3 <- mean(e2$rate)

f <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="75+ years") 
f1 <- mean(f$rate)
f2 <-filter(su_rate1, su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="75+ years")
f3 <- mean(f2$rate)

table <- data.frame(x = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"),
                    y = c(a1, b1, c1, d1, e1, f1))
table$x <- factor(table$x, levels = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"))


p1 <- plot_ly(
  data = table,
  x = ~x,
  y = ~y, 
  type = "bar",
  name = "Male",
  color = I("dodgerblue4")
 
  
) %>%
  
  add_trace(
    y = c(a3, b3, c3, d3, e3, f3),
    name = "Female",
    color = I("firebrick4")
      ) %>%
  
  layout(
    title = "World Average Suicide Rate Across Different Age Categories (2010)", 
    yaxis = list(
      title = "Suicide Rate (per 100,000)"),
    xaxis = list(
      title = "Age"),
    
      barmode = "group"
    )
  

p1
library(plotly)

a <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="5-14 years") 
a1 <- mean(a$rate)
a2 <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="5-14 years")
a3 <- mean(a2$rate)

b <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="15-24 years") 
b1 <- mean(b$rate)
b2 <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="15-24 years")
b3 <- mean(b2$rate)

c <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="25-34 years") 
c1 <- mean(c$rate)
c2 <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="25-34 years")
c3 <- mean(c2$rate)

d <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="35-54 years") 
d1 <- mean(d$rate)
d2 <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="35-54 years")
d3 <- mean(d2$rate)

e <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="55-74 years") 
e1 <- mean(e$rate)
e2 <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="55-74 years")
e3 <- mean(e2$rate)

f <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="75+ years") 
f1 <- mean(f$rate)
f2 <-filter(su_rate1, su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="75+ years")
f3 <- mean(f2$rate)

table <- data.frame(x = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"),
                    y = c(a1, b1, c1, d1, e1, f1))
table$x <- factor(table$x, levels = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"))


p1 <- plot_ly(
  data = table,
  x = ~x,
  y = ~y, 
  type = "bar",
  name = "Male",
  color = I("dodgerblue4")
 
  
) %>%
  
  add_trace(
    y = c(a3, b3, c3, d3, e3, f3),
    name = "Female",
    color = I("firebrick4")
      ) %>%
  
  layout(
    title = "World Average Suicide Rate Across Different Age Categories (2015)", 
    yaxis = list(
      title = "Suicide Rate (per 100,000)"),
    xaxis = list(
      title = "Age"),
    
      barmode = "group"
    )
  

p1
library(plotly)

a <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="5-14 years") 
a1 <- mean(a$rate)
a2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="5-14 years")
a3 <- mean(a2$rate)

b <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="15-24 years") 
b1 <- mean(b$rate)
b2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="15-24 years")
b3 <- mean(b2$rate)

c <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="25-34 years") 
c1 <- mean(c$rate)
c2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="25-34 years")
c3 <- mean(c2$rate)

d <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="35-54 years") 
d1 <- mean(d$rate)
d2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="35-54 years")
d3 <- mean(d2$rate)

e <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="55-74 years") 
e1 <- mean(e$rate)
e2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="55-74 years")
e3 <- mean(e2$rate)

f <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "male" & su_rate1$age =="75+ years") 
f1 <- mean(f$rate)
f2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2000" & su_rate1$sex == "female" & su_rate1$age =="75+ years")
f3 <- mean(f2$rate)

table <- data.frame(x = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"),
                    y = c(a1, b1, c1, d1, e1, f1))
table$x <- factor(table$x, levels = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"))


p1 <- plot_ly(
  data = table,
  x = ~x,
  y = ~y, 
  type = "bar",
  name = "Male",
  color = I("dodgerblue4")
 
  
) %>%
  
  add_trace(
    y = c(a3, b3, c3, d3, e3, f3),
    name = "Female",
    color = I("firebrick4")
      ) %>%
  
  layout(
    title = "US Average Suicide Rate Across Different Age Categories (2000)", 
    yaxis = list(
      title = "Suicide Rate (per 100,000)"),
    xaxis = list(
      title = "Age"),
    
      barmode = "group"
    )
  

p1
library(plotly)

a <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="5-14 years") 
a1 <- mean(a$rate)
a2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="5-14 years")
a3 <- mean(a2$rate)

b <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="15-24 years") 
b1 <- mean(b$rate)
b2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="15-24 years")
b3 <- mean(b2$rate)

c <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="25-34 years") 
c1 <- mean(c$rate)
c2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="25-34 years")
c3 <- mean(c2$rate)

d <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="35-54 years") 
d1 <- mean(d$rate)
d2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="35-54 years")
d3 <- mean(d2$rate)

e <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="55-74 years") 
e1 <- mean(e$rate)
e2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="55-74 years")
e3 <- mean(e2$rate)

f <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "male" & su_rate1$age =="75+ years") 
f1 <- mean(f$rate)
f2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2005" & su_rate1$sex == "female" & su_rate1$age =="75+ years")
f3 <- mean(f2$rate)

table <- data.frame(x = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"),
                    y = c(a1, b1, c1, d1, e1, f1))
table$x <- factor(table$x, levels = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"))


p1 <- plot_ly(
  data = table,
  x = ~x,
  y = ~y, 
  type = "bar",
  name = "Male",
  color = I("dodgerblue4")
 
  
) %>%
  
  add_trace(
    y = c(a3, b3, c3, d3, e3, f3),
    name = "Female",
    color = I("firebrick4")
      ) %>%
  
  layout(
    title = "US Average Suicide Rate Across Different Age Categories (2005)", 
    yaxis = list(
      title = "Suicide Rate (per 100,000)"),
    xaxis = list(
      title = "Age"),
    
      barmode = "group"
    )
  

p1
library(plotly)

a <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="5-14 years") 
a1 <- mean(a$rate)
a2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="5-14 years")
a3 <- mean(a2$rate)

b <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="15-24 years") 
b1 <- mean(b$rate)
b2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="15-24 years")
b3 <- mean(b2$rate)

c <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="25-34 years") 
c1 <- mean(c$rate)
c2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="25-34 years")
c3 <- mean(c2$rate)

d <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="35-54 years") 
d1 <- mean(d$rate)
d2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="35-54 years")
d3 <- mean(d2$rate)

e <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="55-74 years") 
e1 <- mean(e$rate)
e2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="55-74 years")
e3 <- mean(e2$rate)

f <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "male" & su_rate1$age =="75+ years") 
f1 <- mean(f$rate)
f2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2010" & su_rate1$sex == "female" & su_rate1$age =="75+ years")
f3 <- mean(f2$rate)

table <- data.frame(x = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"),
                    y = c(a1, b1, c1, d1, e1, f1))
table$x <- factor(table$x, levels = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"))


p1 <- plot_ly(
  data = table,
  x = ~x,
  y = ~y, 
  type = "bar",
  name = "Male",
  color = I("dodgerblue4")
 
  
) %>%
  
  add_trace(
    y = c(a3, b3, c3, d3, e3, f3),
    name = "Female",
    color = I("firebrick4")
      ) %>%
  
  layout(
    title = "US Average Suicide Rate Across Different Age Categories (2010)", 
    yaxis = list(
      title = "Suicide Rate (per 100,000)"),
    xaxis = list(
      title = "Age"),
    
      barmode = "group"
    )
  

p1
library(plotly)

a <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="5-14 years") 
a1 <- mean(a$rate)
a2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="5-14 years")
a3 <- mean(a2$rate)

b <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="15-24 years") 
b1 <- mean(b$rate)
b2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="15-24 years")
b3 <- mean(b2$rate)

c <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="25-34 years") 
c1 <- mean(c$rate)
c2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="25-34 years")
c3 <- mean(c2$rate)

d <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="35-54 years") 
d1 <- mean(d$rate)
d2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="35-54 years")
d3 <- mean(d2$rate)

e <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="55-74 years") 
e1 <- mean(e$rate)
e2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="55-74 years")
e3 <- mean(e2$rate)

f <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "male" & su_rate1$age =="75+ years") 
f1 <- mean(f$rate)
f2 <-filter(su_rate1, su_rate1$country == "United States of America" & su_rate1$year == "2015" & su_rate1$sex == "female" & su_rate1$age =="75+ years")
f3 <- mean(f2$rate)

table <- data.frame(x = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"),
                    y = c(a1, b1, c1, d1, e1, f1))
table$x <- factor(table$x, levels = c("5-14 years", "15-24 years", "25-34 years", "35-54 years", "55-74 years", "75+ years"))


p1 <- plot_ly(
  data = table,
  x = ~x,
  y = ~y, 
  type = "bar",
  name = "Male",
  color = I("dodgerblue4")
 
  
) %>%
  
  add_trace(
    y = c(a3, b3, c3, d3, e3, f3),
    name = "Female",
    color = I("firebrick4")
      ) %>%
  
  layout(
    title = "US Average Suicide Rate Across Different Age Categories (2015)", 
    yaxis = list(
      title = "Suicide Rate (per 100,000)"),
    xaxis = list(
      title = "Age"),
    
      barmode = "group"
    )
  

p1


3 Conclusions

Therefore, our research was indicative of a modest inversely proportional relationship between income (GDP at PPP) and suicide rate. However, the vast disparity between male suicide rate (higher) vs global female suicide rate (lower) and a positive linear relationship between age and suicide rate reaffirmed its psychosocial impact on suicidal tendencies, whilst unemployment presented a casual relationship.


4 References

Style: APA - referenced throughout.